package com.qczl.pme.controller;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qczl.core.controller.BaseController;
import com.qczl.model.Json;
import com.qczl.pme.service.MettingService;
import com.qczl.pme.vo.MettingVo;

/**
 * 会议记录控制器
 * @author SongR
 *
 */
@Controller
@RequestMapping(value="/metting")
public class MettingController extends BaseController{

	Logger log = Logger.getLogger(this.getClass());
	
	@Autowired
	MettingService service;
	
	/**
	 * 获取会议记录
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/get/v1",method={RequestMethod.GET,RequestMethod.POST})
	public Json getMettingV1(String stbno,String cameraid,int start,int size){
		Json j = new Json();
		try {
			List<MettingVo> vos = service.getMettingV1(cameraid,start,size);
			if(vos.size()>0){
				j.setMsg("成功获取会议记录！");
				j.setLength(new Long(vos.size()));
				j.setResult(vos);
				j.setSize(service.countMettingV1(cameraid));
			}else{
				j.setMsg("暂无会议记录!");
			}
		} catch (Exception e) {
			j.setMsg("获取会议记录接口异常！");
			j.setSuccess(false);
			j.setState(500);
		}
		return j;
	}
	
}
